<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/11/18
  Time: 16:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">

    <title>编辑用户</title>
    <style>
     body{
         background:url(image/1.jpg) ;
     }
        #div1{
            text-align: center;
            border: 2px solid lightblue;
            margin-left: 10px;
            margin-right: 10px;
            width:95%;
            height:40%;
            background-color:rgba(243,213,224,0.4);
        }
    </style>
    <script type="text/javascript">
        function updateUser(){
            var form = document.forms[0];
            form.action = "<%=basePath%>user/updateUser";
            form.method="post";
            form.submit();
        }
    </script>

</head>

<body>
<div id="div1">
<h3 align="center">添加用户</h3>
<form action="" name="userForm">
    <tr><td><input type="hidden" name="id" value="${user.id }"/></td>
        <td>姓名：<input type="text" name="userName" value="${user.userName }"/></td>
        <td>年龄：<input type="text" name="age" value="${user.age }"/></td>
        <td>性别：<select name="sex" id="sex" value="${user.sex }">
            <option value="男">男</option>
            <option value="女">女</option>
        </select></td>
        <td>职业：<input type="text" id="job" name="job" value="${user.job}"/></td>
        <td> 学校：<textarea name = "school" id="school" cols="25" rows="1">${user.school}</textarea></td>
        <td>爱好：<input type="text" name="hobby" value="${user.hobby}"/></td>
        <td><input type="button" value="编辑" onclick="updateUser()"/></td>
    </tr>
</form>
</div>
</body>

</html>
